QReadWriteLock: fix data race on weakly-ordered memory architectures
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 29 Jan 2026 19:25:23 +0000 (22:25 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 29 Jan 2026 19:25:23 +0000 (22:25 +0300)
commitf6bb62076c224cf421f244ad762a30a112112b9c
tree8ee5dc7398bd2c3ed5eab1f28667cb918503da60
parent6ce270bd78b436c69051b95f1566957df90034ab
QReadWriteLock: fix data race on weakly-ordered memory architectures

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit?id=4fd88011fa7975ce
Last-Update: 2025-12-14

The fix changes the relaxed load of d_ptr in lockFor{Read,Write} after
the acquire of the mutex to an acquire load, to establish
synchronization with the release store of d_ptr when converting from an
uncontended lock to a contended lock.

Gbp-Pq: Name qreadwritelock_data_race_2.diff
src/corelib/thread/qreadwritelock.cpp
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp